﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Advanced_CSharp_Features
{
    public static class StringBuilderExtensions
    {
        public static StringBuilder Substring(this StringBuilder strBuilder, int index, int lenght)
        {
            StringBuilder result = new StringBuilder();
            for (int i = 0; i < lenght; i++)
            {
                result.Append(strBuilder[index + i]);
            }
            return result;
        }

        public static StringBuilder Substring(this StringBuilder strBuilder, int index)
        {
            StringBuilder result = new StringBuilder();
            for (int i = 0; i < strBuilder.Length; i++)
            {
                result.Append(strBuilder[index + i]);
            }
            return result;
        }
    }
}
